package Function;

import book.BookList;

import java.util.Scanner;

public class Find  implements All{
    @Override
    public void work(BookList book) {
        System.out.println("开始查找图书请输入书名：");
        Scanner in=new Scanner(System.in);
        String bookname=in.nextLine();
        for(int i=0;i< book.getCount();i++){
            if(bookname.equals(book.getBook1(i).getName())){
                System.out.println("找到了"+book.getBook1(i));
                return;
            }
        }
        System.out.println("抱歉目前还没有这本书~~~");
    }
}
